Skip to content

[Reviewed] [Sticker] Restore attachments when loading a save state - #2376

Open
Caf3z1n wants to merge 1 commit into
GDevelopApp:mainfrom
Caf3z1n:fix/sticker-save-state
Open

Caf3z1n wants to merge 1 commit into
GDevelopApp:mainfrom
Caf3z1n:fix/sticker-save-state

Conversation

@Caf3z1n

@Caf3z1n Caf3z1n commented Nov 25, 2026

Copy link
Copy Markdown

Description

Fixes #2040.

Sticker keeps its parent as a runtime object reference. When Save State recreates the instances, that reference is lost. This change records the Sticker owner, behavior name, and parent network ID in the scene snapshot. It restores attachments after the instances have been recreated, so the sticker follows the correct parent even when several instances share the same object type.

Snapshots without Sticker data retain their previous behavior. The restore also respects the selected save profiles and leaves the sticker detached if the recorded parent is missing. The validator change permits the required scene APIs for Sticker only.

How to test

Open game.json from the attached ZIP in GDevelop 5.6.287 and run its five gameplay tests. The IndexedDB case saves the game, deletes the original objects, reloads, then checks that the sticker follows the same parent with its original offset. The other cases cover serialized snapshots, in-place restoration, profile-excluded objects, legacy saves, and a missing parent. Three tests fail on the current extension and all five pass with the fix. The extension repository build and automated checks also passed.

AI usage

  • I used an AI to generate some part of the code.

Codex helped investigate the runtime behavior and generated the patch and regression project. The tests were executed locally in GDevelop Desktop, including the IndexedDB save and load.

Example project

gdevelop-2040-sticker-save-state-example.zip

@Caf3z1n
Caf3z1n requested review from a team as code owners November 25, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sticker] Important issue for sticker and save state behaviors

1 participant